home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / QuickTime / QuickTime 3 Interfaces & Libs / QTDevWin / CIncludes / Folders.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-21  |  11.3 KB  |  319 lines  |  [TEXT/dosa]

  1. /*
  2.      File:        Folders.h
  3.  
  4.      Contains:    Folder Manager Interfaces.
  5.  
  6.      Version:    Technology:    Mac OS 8
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __FOLDERS__
  19. #define __FOLDERS__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24.  
  25.  
  26.  
  27. #if PRAGMA_ONCE
  28. #pragma once
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. #if PRAGMA_IMPORT
  36. #pragma import on
  37. #endif
  38.  
  39. #if PRAGMA_STRUCT_ALIGN
  40.     #pragma options align=mac68k
  41. #elif PRAGMA_STRUCT_PACKPUSH
  42.     #pragma pack(push, 2)
  43. #elif PRAGMA_STRUCT_PACK
  44.     #pragma pack(2)
  45. #endif
  46.  
  47.  
  48. enum {
  49.     kOnSystemDisk                = -32768L                        /* previously was 0x8000 but that is an unsigned value whereas vRefNum is signed*/
  50. };
  51.  
  52.  
  53. enum {
  54.     kCreateFolder                = true,
  55.     kDontCreateFolder            = false
  56. };
  57.  
  58.  
  59. enum {
  60.     kSystemFolderType            = FOUR_CHAR_CODE('macs'),        /* the system folder */
  61.     kDesktopFolderType            = FOUR_CHAR_CODE('desk'),        /* the desktop folder; objects in this folder show on the desk top. */
  62.     kTrashFolderType            = FOUR_CHAR_CODE('trsh'),        /* the trash folder; objects in this folder show up in the trash */
  63.     kWhereToEmptyTrashFolderType = FOUR_CHAR_CODE('empt'),        /* the "empty trash" folder; Finder starts empty from here down */
  64.     kPrintMonitorDocsFolderType    = FOUR_CHAR_CODE('prnt'),        /* Print Monitor documents */
  65.     kStartupFolderType            = FOUR_CHAR_CODE('strt'),        /* Finder objects (applications, documents, DAs, aliases, to...) to open at startup go here */
  66.     kShutdownFolderType            = FOUR_CHAR_CODE('shdf'),        /* Finder objects (applications, documents, DAs, aliases, to...) to open at shutdown go here */
  67.     kAppleMenuFolderType        = FOUR_CHAR_CODE('amnu'),        /* Finder objects to put into the Apple menu go here */
  68.     kControlPanelFolderType        = FOUR_CHAR_CODE('ctrl'),        /* Control Panels go here (may contain INITs) */
  69.     kExtensionFolderType        = FOUR_CHAR_CODE('extn'),        /* System extensions go here */
  70.     kFontsFolderType            = FOUR_CHAR_CODE('font'),        /* Fonts go here */
  71.     kPreferencesFolderType        = FOUR_CHAR_CODE('pref'),        /* preferences for applications go here */
  72.     kTemporaryFolderType        = FOUR_CHAR_CODE('temp')        /* temporary files go here (deleted periodically, but don't rely on it.) */
  73. };
  74.  
  75. /*
  76.     Note:     The FindFolder trap was not implemented until System 7.  If you want to call FindFolder
  77.             while running on System 6 machines, then define USE_FINDFOLDER_GLUE and link with
  78.             Interface.o which contains glue to implement FindFolder on pre-System 7 machines.
  79. */
  80. #ifdef USE_FINDFOLDER_GLUE
  81. EXTERN_API( OSErr )
  82. FindFolder                        (short                     vRefNum,
  83.                                  OSType                 folderType,
  84.                                  Boolean                 createFolder,
  85.                                  short *                foundVRefNum,
  86.                                  long *                    foundDirID);
  87.  
  88. #else
  89. EXTERN_API( OSErr )
  90. FindFolder                        (short                     vRefNum,
  91.                                  OSType                 folderType,
  92.                                  Boolean                 createFolder,
  93.                                  short *                foundVRefNum,
  94.                                  long *                    foundDirID)                            TWOWORDINLINE(0x7000, 0xA823);
  95.  
  96. #endif  /*  defined(USE_FINDFOLDER_GLUE)  */
  97.  
  98. EXTERN_API( OSErr )
  99. ReleaseFolder                    (short                     vRefNum,
  100.                                  OSType                 folderType)                            TWOWORDINLINE(0x700B, 0xA823);
  101.  
  102.  
  103. #if !TARGET_OS_MAC
  104. /* Since non-mac targets don't know about VRef's or DirID's, the Ex version returns
  105.    the found folder path.
  106.  */
  107. EXTERN_API_C( OSErr )
  108. FindFolderEx                    (short                     vRefNum,
  109.                                  OSType                 folderType,
  110.                                  Boolean                 createFolder,
  111.                                  short *                foundVRefNum,
  112.                                  long *                    foundDirID,
  113.                                  char *                    foundFolder);
  114.  
  115. #endif  /*  !TARGET_OS_MAC */
  116.  
  117. /******************************************/
  118. /* Extensible Folder Manager declarations */
  119. /******************************************/
  120.  
  121. /****************************/
  122. /* Folder Manager constants */
  123. /****************************/
  124.  
  125.  
  126. enum {
  127.     kExtensionDisabledFolderType = FOUR_CHAR_CODE('extD'),
  128.     kControlPanelDisabledFolderType = FOUR_CHAR_CODE('ctrD'),
  129.     kSystemExtensionDisabledFolderType = FOUR_CHAR_CODE('macD'),
  130.     kStartupItemsDisabledFolderType = FOUR_CHAR_CODE('strD'),
  131.     kShutdownItemsDisabledFolderType = FOUR_CHAR_CODE('shdD'),
  132.     kApplicationsFolderType        = FOUR_CHAR_CODE('apps'),
  133.     kDocumentsFolderType        = FOUR_CHAR_CODE('docs')
  134. };
  135.  
  136.  
  137. enum {
  138.                                                                 /* new constants */
  139.     kVolumeRootFolderType        = FOUR_CHAR_CODE('root'),        /* root folder of a volume */
  140.     kChewableItemsFolderType    = FOUR_CHAR_CODE('flnt'),        /* items deleted at boot */
  141.     kApplicationSupportFolderType = FOUR_CHAR_CODE('asup'),        /* third-party items and folders */
  142.     kTextEncodingsFolderType    = FOUR_CHAR_CODE('ƒtex'),        /* encoding tables */
  143.     kStationeryFolderType        = FOUR_CHAR_CODE('odst'),        /* stationery */
  144.     kOpenDocFolderType            = FOUR_CHAR_CODE('odod'),        /* OpenDoc root */
  145.     kOpenDocShellPlugInsFolderType = FOUR_CHAR_CODE('odsp'),    /* OpenDoc Shell Plug-Ins in OpenDoc folder */
  146.     kEditorsFolderType            = FOUR_CHAR_CODE('oded'),        /* OpenDoc editors in MacOS Folder */
  147.     kOpenDocEditorsFolderType    = FOUR_CHAR_CODE('ƒodf'),        /* OpenDoc subfolder of Editors folder */
  148.     kOpenDocLibrariesFolderType    = FOUR_CHAR_CODE('odlb'),        /* OpenDoc libraries folder */
  149.     kGenEditorsFolderType        = FOUR_CHAR_CODE('ƒedi'),        /* CKH general editors folder at root level of Sys folder */
  150.     kHelpFolderType                = FOUR_CHAR_CODE('ƒhlp'),        /* CKH help folder currently at root of system folder */
  151.     kInternetPlugInFolderType    = FOUR_CHAR_CODE('ƒnet'),        /* CKH internet plug ins for browsers and stuff */
  152.     kModemScriptsFolderType        = FOUR_CHAR_CODE('ƒmod'),        /* CKH modem scripts, get 'em OUT of the Extensions folder */
  153.     kPrinterDescriptionFolderType = FOUR_CHAR_CODE('ppdf'),        /* CKH new folder at root of System folder for printer descs. */
  154.     kPrinterDriverFolderType    = FOUR_CHAR_CODE('ƒprd'),        /* CKH new folder at root of System folder for printer drivers */
  155.     kScriptingAdditionsFolderType = FOUR_CHAR_CODE('ƒscr'),        /* CKH at root of system folder */
  156.     kSharedLibrariesFolderType    = FOUR_CHAR_CODE('ƒlib'),        /* CKH for general shared libs. */
  157.     kVoicesFolderType            = FOUR_CHAR_CODE('fvoc'),        /* CKH macintalk can live here */
  158.     kControlStripModulesFolderType = FOUR_CHAR_CODE('sdev'),    /* CKH for control strip modules */
  159.     kAssistantsFolderType        = FOUR_CHAR_CODE('astƒ'),        /* SJF for Assistants (MacOS Setup Assistant, etc) */
  160.     kUtilitiesFolderType        = FOUR_CHAR_CODE('utiƒ'),        /* SJF for Utilities folder */
  161.     kAppleExtrasFolderType        = FOUR_CHAR_CODE('aexƒ'),        /* SJF for Apple Extras folder */
  162.     kContextualMenuItemsFolderType = FOUR_CHAR_CODE('cmnu'),    /* SJF for Contextual Menu items */
  163.     kMacOSReadMesFolderType        = FOUR_CHAR_CODE('morƒ'),        /* SJF for MacOS ReadMes folder */
  164.     kALMModulesFolderType        = FOUR_CHAR_CODE('walk'),        /* EAS for Location Manager Module files except type 'thng' (within kExtensionFolderType) */
  165.     kALMPreferencesFolderType    = FOUR_CHAR_CODE('trip'),        /* EAS for Location Manager Preferences (within kPreferencesFolderType; contains kALMLocationsFolderType) */
  166.     kALMLocationsFolderType        = FOUR_CHAR_CODE('fall'),        /* EAS for Location Manager Locations (within kALMPreferencesFolderType) */
  167.     kColorSyncProfilesFolderType = FOUR_CHAR_CODE('prof'),        /* for ColorSync™ Profiles */
  168.     kThemesFolderType            = FOUR_CHAR_CODE('thme'),        /* for Theme data files */
  169.     kFavoritesFolderType        = FOUR_CHAR_CODE('favs')        /* Favorties folder for Navigation Services */
  170. };
  171.  
  172.  
  173. /* FolderDescFlags values */
  174.  
  175. enum {
  176.     kCreateFolderAtBoot            = 0x00000002,
  177.     kFolderCreatedInvisible        = 0x00000004,
  178.     kFolderCreatedNameLocked    = 0x00000008
  179. };
  180.  
  181. typedef UInt32                             FolderDescFlags;
  182. /* FolderClass values */
  183.  
  184. enum {
  185.     kRelativeFolder                = FOUR_CHAR_CODE('relf'),
  186.     kSpecialFolder                = FOUR_CHAR_CODE('spcf')
  187. };
  188.  
  189. typedef OSType                             FolderClass;
  190. /* special folder locations */
  191.  
  192. enum {
  193.     kBlessedFolder                = FOUR_CHAR_CODE('blsf'),
  194.     kRootFolder                    = FOUR_CHAR_CODE('rotf')
  195. };
  196.  
  197. typedef OSType                             FolderType;
  198. typedef OSType                             FolderLocation;
  199.  
  200.  
  201. struct FolderDesc {
  202.     Size                             descSize;
  203.     FolderType                         foldType;
  204.     FolderDescFlags                 flags;
  205.     FolderClass                     foldClass;
  206.     FolderType                         foldLocation;
  207.     OSType                             badgeSignature;
  208.     OSType                             badgeType;
  209.     UInt32                             reserved;
  210.     StrFileName                     name;                        /* Str63 on MacOS*/
  211. };
  212. typedef struct FolderDesc                FolderDesc;
  213. typedef FolderDesc *                    FolderDescPtr;
  214.  
  215.  
  216. typedef UInt32                             RoutingFlags;
  217.  
  218. struct FolderRouting {
  219.     Size                             descSize;
  220.     OSType                             fileType;
  221.     FolderType                         routeFromFolder;
  222.     FolderType                         routeToFolder;
  223.     RoutingFlags                     flags;
  224. };
  225. typedef struct FolderRouting            FolderRouting;
  226. typedef FolderRouting *                    FolderRoutingPtr;
  227. /* routing constants */
  228. /***************************/
  229. /* Folder Manager routines */
  230. /***************************/
  231. /* Folder Manager administration routines */
  232. EXTERN_API( OSErr )
  233. AddFolderDescriptor                (FolderType             foldType,
  234.                                  FolderDescFlags         flags,
  235.                                  FolderClass             foldClass,
  236.                                  FolderLocation         foldLocation,
  237.                                  OSType                 badgeSignature,
  238.                                  OSType                 badgeType,
  239.                                  ConstStrFileNameParam     name,
  240.                                  Boolean                 replaceFlag)                        TWOWORDINLINE(0x7020, 0xA823);
  241.  
  242. EXTERN_API( OSErr )
  243. GetFolderDescriptor                (FolderType             foldType,
  244.                                  Size                     descSize,
  245.                                  FolderDesc *            foldDesc)                            TWOWORDINLINE(0x7023, 0xA823);
  246.  
  247. EXTERN_API( OSErr )
  248. GetFolderTypes                    (UInt32                 requestedTypeCount,
  249.                                  UInt32 *                totalTypeCount,
  250.                                  FolderType *            theTypes)                            TWOWORDINLINE(0x7024, 0xA823);
  251.  
  252. EXTERN_API( OSErr )
  253. RemoveFolderDescriptor            (FolderType             foldType)                            TWOWORDINLINE(0x7021, 0xA823);
  254.  
  255. /* legacy routines */
  256. EXTERN_API( OSErr )
  257. GetFolderName                    (short                     vRefNum,
  258.                                  OSType                 foldType,
  259.                                  short *                foundVRefNum,
  260.                                  StrFileName             name)                                TWOWORDINLINE(0x700E, 0xA823);
  261.  
  262. /* routing routines */
  263. EXTERN_API( OSErr )
  264. AddFolderRouting                (OSType                 fileType,
  265.                                  FolderType             routeFromFolder,
  266.                                  FolderType             routeToFolder,
  267.                                  RoutingFlags             flags,
  268.                                  Boolean                 replaceFlag)                        TWOWORDINLINE(0x7026, 0xA823);
  269.  
  270. EXTERN_API( OSErr )
  271. RemoveFolderRouting                (OSType                 fileType,
  272.                                  FolderType             routeFromFolder)                    TWOWORDINLINE(0x7027, 0xA823);
  273.  
  274. EXTERN_API( OSErr )
  275. FindFolderRouting                (OSType                 fileType,
  276.                                  FolderType             routeFromFolder,
  277.                                  FolderType *            routeToFolder,
  278.                                  RoutingFlags *            flags)                                TWOWORDINLINE(0x7022, 0xA823);
  279.  
  280. EXTERN_API( OSErr )
  281. GetFolderRoutings                (UInt32                 requestedRoutingCount,
  282.                                  UInt32 *                totalRoutingCount,
  283.                                  Size                     routingSize,
  284.                                  FolderRouting *        theRoutings)                        TWOWORDINLINE(0x701E, 0xA823);
  285.  
  286. EXTERN_API( OSErr )
  287. InvalidateFolderDescriptorCache    (short                     vRefNum,
  288.                                  long                     dirID)                                TWOWORDINLINE(0x7025, 0xA823);
  289.  
  290. EXTERN_API( OSErr )
  291. IdentifyFolder                    (short                     vRefNum,
  292.                                  long                     dirID,
  293.                                  FolderType *            foldType)                            TWOWORDINLINE(0x701F, 0xA823);
  294.  
  295.  
  296.  
  297.  
  298.  
  299. #if PRAGMA_STRUCT_ALIGN
  300.     #pragma options align=reset
  301. #elif PRAGMA_STRUCT_PACKPUSH
  302.     #pragma pack(pop)
  303. #elif PRAGMA_STRUCT_PACK
  304.     #pragma pack()
  305. #endif
  306.  
  307. #ifdef PRAGMA_IMPORT_OFF
  308. #pragma import off
  309. #elif PRAGMA_IMPORT
  310. #pragma import reset
  311. #endif
  312.  
  313. #ifdef __cplusplus
  314. }
  315. #endif
  316.  
  317. #endif /* __FOLDERS__ */
  318.  
  319.